#pragma once

#include "../Base/BaseData.hpp"

using namespace base;

template <typename TTree, typename TElemType>
class MasterBinaryTree {
public:
    virtual ~MasterBinaryTree() = default;

    virtual Status initBiTree(TTree& t) = 0;
    virtual Status destoryBiTree(TTree& t) = 0;
    virtual Status createBiTree(TTree& t, const std::string& definition) = 0;
    virtual Status clearBiTree(TTree& t) = 0;
    virtual bool biTreeEmpty(const TTree t) = 0;
    virtual int biTreeDepth(const TTree t) = 0;
    virtual TTree root(const TTree t) = 0;
    virtual TElemType value(const TTree t, TElemType e) = 0;
    virtual Status assign(const TTree t, TElemType& e, TElemType value) = 0;
    virtual Status parent(const TTree t, TElemType e) = 0;
    virtual Status leftChild(const TTree t, TElemType e) = 0;
    virtual Status rightChild(const TTree t, TElemType e) = 0;
    virtual Status leftSibling(const TTree t, TElemType e) = 0;
    virtual Status rightSibling(const TTree t, TElemType e) = 0;
    virtual Status insertChild(TTree& t) = 0;
    virtual Status deleteChild(TTree& t) = 0;
    virtual Status preOrderTraverse(const TTree t) = 0;
    virtual Status inOrderTraverse(const TTree t) = 0;
    virtual Status postOrderTraverse(const TTree t) = 0;
    virtual Status levelOrderTraverse(const TTree t) = 0;
};
